package com.skiving.cloud.auth.config;

import feign.Feign;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder;
import feign.solon.FeignClient;
import feign.solon.FeignConfiguration;
import org.noear.solon.annotation.Component;

@Component
public class ClientFeignConfiguration implements FeignConfiguration {
    @Override
    public Feign.Builder config(FeignClient client, Feign.Builder builder) {
        return builder.encoder(new JacksonEncoder())
                .decoder(new JacksonDecoder())
                .requestInterceptor(new TokenRequestInterceptor());
    }
}
